import loguru


class KAFKALogs:
    def __init__(self, log_file, file_size=10, backup_count=3, level="INFO", file_path="logs"):
        self.log_file = log_file
        self.file_size = file_size
        self.backup_count = backup_count
        self.level = level
        self.file_path = file_path

    def get_logger(self):
        logger = loguru.logger
        logger.add(self.log_file, rotation=f"{self.file_size} MB", retention=f"{self.backup_count} days",
                   level=self.level)
        return logger


global_log = KAFKALogs("KAFKA.log").get_logger()

if __name__ == '__main__':
    global_log.info("This is a test log")
    global_log.warning("This is a test log")
    global_log.error("This is a test log")
